package edu.dayu.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import edu.dayu.domain.Student;
import edu.dayu.service.StudentService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Slf4j
public class StudentController {
    @Autowired
    private StudentService studentService;

    @PostMapping("/{route}/queryStudentAll")
    public List<Student> queryStudentAll(@PathVariable(value = "route") String route){
       List<Student> students =  studentService.queryStudentAll(new Student());
       log.info("路由---------------"+route);
       return students;
    }

    @PostMapping("/{route}/queryStudent")
    public Student queryStudent(@PathVariable(value = "route") String route,String id){
        Student student = studentService.getById(id);
        log.info("路由---------------"+route);
        return student;
    }
}
